import 'package:flutter/material.dart';
import 'package:xindong/common/xindong_sezhi.dart';
import 'package:xindong/common/xindong_define.dart';

class XinDongAppBarTextButton extends StatelessWidget {
  final String name;
  final Color? color;
  final Function()? onTap;

  const XinDongAppBarTextButton({Key? key, required this.name, this.color, required this.onTap}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      behavior: HitTestBehavior.opaque,
      child: Container(
        padding: const EdgeInsets.only(left: kPaddingValue, right: kPaddingValue),
        alignment: Alignment.centerRight,
        constraints: const BoxConstraints(minWidth: 44),
        child: Text(
          name,
          style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: color ?? DZColors.mainColor, height: 1.2),
        ),
      ),
    );
  }
}
